<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BulkEdit-Insert.aspx.cs" Inherits="BulkEdit_Insert" %>
<%--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form2" runat="server">
        <div>
            <asp:Button runat="server" ID="SaveButton" Text="Save Data" />
            <rwg:BulkEditGridView ID="EditableGrid" DataSourceID="PubsDataSource" AutoGenerateColumns="False"
                SaveButtonID="SaveButton" runat="server" EnableInsert="true" InsertRowCount="2" ShowFooter="false">
                <InsertRowStyle BackColor="CornSilk" />
                <Columns>
                    <asp:BoundField HeaderText="ID" DataField="au_id" />
                    <asp:BoundField HeaderText="Last Name" DataField="au_lname" />
                    <asp:BoundField HeaderText="First Name" DataField="au_fname" />
                    <asp:BoundField HeaderText="Phone" DataField="phone" />
                    <asp:BoundField HeaderText="Address" DataField="address" />
                    <asp:BoundField HeaderText="City" DataField="city" />
                    <asp:BoundField HeaderText="State" DataField="state" />
                    <asp:BoundField HeaderText="Zip Code" DataField="zip" />
                    <asp:CheckBoxField HeaderText="Contract" DataField="contract" />
                </Columns>
            </rwg:BulkEditGridView>
            <asp:SqlDataSource ID="PubsDataSource" runat="server" 
                SelectCommand="SELECT [au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract] FROM [authors]"
                UpdateCommand="UPDATE [authors] SET [au_lname] = @au_lname, [au_fname] = @au_fname, [phone] = @phone, [address] = @address, [city] = @city, [state] = @state, [zip] = @zip, [contract]=@contract WHERE [au_id] = @au_id"
                InsertCommand="INSERT INTO [authors] ([au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract]) VALUES (@au_id, @au_lname, @au_fname, @phone, @address, @city, @state, @zip, @contract)"
                ConnectionString="<%$ ConnectionStrings:Pubs %>"  />
        </div>
    </form>
</body>
</html>

